import { Directive } from "vue";
import type { DirectiveBinding } from "vue";
import hljs from 'highlight.js' //导入代码高亮文件
import 'highlight.js/styles/monokai-sublime.css'  //导入代码高亮样式

export const code: Directive = {
  mounted(el: HTMLElement, binding: DirectiveBinding) {
    const blocks = el.querySelectorAll('pre code');
    blocks.forEach((block: any) => {
      hljs.highlightBlock(block)
    })
  }
};
